package com.spring.data.seruce.sophiaresource.controller;


import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试接口
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/resource")
public class TestController {

    @GetMapping("/test01")
    public String testDemo01() {
        return "测试成功!返回数据";
    }


    @PreAuthorize("hasAnyAuthority('admin')")
    @GetMapping("/test")
    public String testDemo() {
        return "测试成功!返回数据";
    }
}
